package com.weidft.dal.warehouse.dao.ibatis;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.weidft.dal.warehouse.dao.ISparRuDao;
import com.weidft.dal.warehouse.daoobject.QueryDO;
import com.weidft.dal.warehouse.daoobject.SparRuDO;

public class IBatisSparRuDao extends SqlMapClientDaoSupport implements  ISparRuDao{
    public Integer insertSparRuDO(SparRuDO sparRuDO)
    {
    	int id =  (Integer) getSqlMapClientTemplate().insert("SPAR_RU.insert",sparRuDO);
        return id;
    }

    public Integer countSparRuDO(SparRuDO sparRuDO)
    {
    	return (Integer) getSqlMapClientTemplate().queryForObject("SPAR_RU.count", sparRuDO);
    }

    @SuppressWarnings("unchecked")
	public List<SparRuDO> listSparRuDO(SparRuDO sparRuDO)
    {
        return getSqlMapClientTemplate().queryForList("SPAR_RU.list",sparRuDO);
    }
    
    @SuppressWarnings("unchecked")
	public List<SparRuDO> listOnline(QueryDO queryDO)
    {
        return getSqlMapClientTemplate().queryForList("SPAR_RU.listOnline",queryDO);
    }
    

    public SparRuDO getSparRuDOById(int id)
    {
    	return (SparRuDO) getSqlMapClientTemplate().queryForObject("SPAR_RU.findById", id);
    }

    public void updateSparRuDO(SparRuDO sparRuDO)
    {
    	getSqlMapClientTemplate().update("SPAR_RU.update",sparRuDO);
    }

    public void deleteSparRuDO(int id)
    {
    	getSqlMapClientTemplate().delete("SPAR_RU.deleteById",id);
    }
}
